I am a software developer at MindStick soft. Pvt. ltd. I joined this company in august 2021 after completing my post-graduation course. I love to see the historical places of my country.
Data Manipulation Language (DML) triggers are fired in response to events caused by DML statements like INSERT, UPDATE, and DELETE. They can also be triggered by system-defined stored procedures that perform operations similar to DML statements. These triggers can be used to ensure data integrity and also to query other tables.
There are two types of DML triggers:
a. AFTER Trigger It is fired when the SQL server action that triggered it is completed. It is typically executed whenever an INSERT, UPDATE, or DELETE operation on a table is completed.
Example:
b. INSTEAD OF Trigger
It is fired before the SQL server begins executing the action that triggers it. Hence, the trigger will fire even if the constraint check fails.
Example:
Liked By
Write Answer
Explain about DML trigger with an example.
Join MindStick Community
You have need login or register for voting of answers or question.
Krishnapriya Rajeev
30-Mar-2023Data Manipulation Language (DML) triggers are fired in response to events caused by DML statements like INSERT, UPDATE, and DELETE. They can also be triggered by system-defined stored procedures that perform operations similar to DML statements. These triggers can be used to ensure data integrity and also to query other tables.
There are two types of DML triggers:
a. AFTER Trigger
It is fired when the SQL server action that triggered it is completed. It is typically executed whenever an INSERT, UPDATE, or DELETE operation on a table is completed.
Example:
b. INSTEAD OF Trigger
It is fired before the SQL server begins executing the action that triggers it. Hence, the trigger will fire even if the constraint check fails.
Example: